package com.atguigu.juc.day03.aqs;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class DemoDebug {

    public static void main(String[] args) {

        // 1、创建锁对象
        Lock lock = new ReentrantLock();

        new Thread(()->{
            // 2、调用加锁方法
            lock.lock();

            // 3、锁重入
            lock.lock();

            // 4、解锁
            lock.unlock();

            lock.unlock();
        }, "thread-a").start();

        new Thread(()->{
            lock.lock();
        }, "thread-b").start();

    }

}
